package com.microstation.service.impl;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.microstation.service.VehicleGuideService;
import com.microstation.dao.VehicleGuideDao;
import com.microstation.common.Assist;
import com.microstation.common.Result;
import com.microstation.entity.po.VehicleGuide;
/**
 * VehicleGuide的服务接口的实现类
 * 
 * @author 
 *
 */
@Service
public class VehicleGuideServiceImpl implements VehicleGuideService {
	private final Logger LOG = LoggerFactory.getLogger(this.getClass());

	@Autowired
	private VehicleGuideDao vehicleGuideDao;

	@Override
	public Result find(Assist assist) {
		//TODO这里可以做通过Assist做添加查询
		long results = vehicleGuideDao.getVehicleGuideRowCount(assist);
		List<VehicleGuide> result = vehicleGuideDao.selectVehicleGuide(assist);
		return new Result(results, result);
	}
	@Override
	public VehicleGuide findOne(Long id) {
		if (id == null) {
			return null;
		}
		VehicleGuide result = vehicleGuideDao.selectVehicleGuideById(id);
		return result;
	}

	@Override
	public Integer saveNotNull(VehicleGuide value) {
		if (value == null) {
			return null;
		}
		int result = vehicleGuideDao.insertNotNullVehicleGuide(value);
		return result;
	}
	@Override
	public Integer updateNotNullById(VehicleGuide value) {
		if (value == null) {
			return null;
		}
		int result = vehicleGuideDao.updateNotNullVehicleGuideById(value);
		return result;
	}

	@Override
	public Integer deleteById(Long id) {
		if (id == null) {
			return null;
		}
		int result = vehicleGuideDao.deleteVehicleGuideById(id);
		return result;
	}


}